<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<style>
  .Line{
    color: red;
  }
</style>

<body>
<div id="app">
<!--   <h2 v-bind:class="{key1:value1,key2:value2}">{{message}}</h2> -->
<!--   <h2 v-bind:class="{key1:true,key2:boolean}">{{message}}</h2> -->
  <h2 class="title" v-bind:class="{active:isActive,Line:isLine}">{{message}}</h2>
  <h2 class="title" v-bind:class="getClass()">{{message}}</h2>
  <button v-on:click="btnClick">按钮</button>
</div>
<script src="../js/vue.js"></script>
<script>
  const vm=new Vue({
    el:'#app',
    data:{
      message:'你好啊!',
      isActive:true,
      isLine:true
    },
    methods:{
      btnClick(){
        this.isLine=!this.isLine
      },
      getClass:function () {
        return {active:this.isActive,Line:this.isLine}
      }
    }
  })
</script>

</body>
</html>